package com.woniuxy.factory.service.imp;

import com.woniuxy.factory.entity.Inventory;
import com.woniuxy.factory.mapper.InventoryMapper;
import com.woniuxy.factory.mapper.MateralDetailedMapper;
import com.woniuxy.factory.mapper.PurchasegoodsMapper;
import com.woniuxy.factory.service.InventoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 邹佳骏
 * @date 2020-08-22 15:01
 */
@Service
public class InventoryServiceImp implements InventoryService {

    //库存的mapper
    @Autowired
    InventoryMapper inventoryMapper;

    //采购详情的mapper
    @Autowired
    PurchasegoodsMapper purchasegoodsMapper;

    //用料详情的mapper
    @Autowired
    MateralDetailedMapper materalDetailedMapper;




    @Override
    public List<Inventory> selectAll(Integer page, Integer limit, Inventory inventory) {
        int home = (page-1)*limit;

        List<Inventory> inventories = inventoryMapper.selectAllInventorys(home, limit, inventory);

        return inventories;
    }

    @Override
    public int selectAllcount() {

        int count = inventoryMapper.selectAllCount();

        return count;
    }



}
